package com.noble.meether.ui.certify.dialog;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.noble.library.view.base.BaseDialogFragment;
import com.noble.meether.R;

/**
 * 认证失败
 */
@SuppressLint("ValidFragment")
public class SexAuthFailDlg extends BaseDialogFragment implements View.OnClickListener {
    private String content;

    public SexAuthFailDlg(String content) {
        settWindowAnimations(R.style.AnimDownInDownOutOverShoot);
        setGravity(Gravity.CENTER);
        setDialogSizeRatio(0, 0);
        setCanceledOnTouchOutside(false);
        this.content = content;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        setContentView(R.layout.dialog_sex_auth_fail);
        initView();
        return getContentView();
    }

    private void initView() {
        TextView tvContent = (TextView) findViewById(R.id.tv_content);
        findViewById(R.id.btn_submit).setOnClickListener(this);

        if (!TextUtils.isEmpty(content)) {
            tvContent.setText(content);
        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_submit:
                dismiss();
                break;
        }
    }
}